//
//  HR_BLELinkManager.h
//  Pods
//
//  Created by xiaoming on 17/07/24.
//
//

#import <Foundation/Foundation.h>
#import "HR_BLELinkConstant.h"
#import <CoreBluetooth/CoreBluetooth.h>

@class HR_BLELinkInfoModel;

@protocol BlueToothLinkDelegate <NSObject>

/**
 更新连接状态
 
 @param status status description
 */
- (void)updateConnectStatus:(SYS_STATUS)status;

/**
 启动跑步机倒计时
 
 @param countdown countdown
 */
- (void)countdown:(int)countdown;

/**
 更新蓝牙信息数据
 
 @param model BLE link info model
 */
- (void)updateBLEDataWithModel:(HR_BLELinkInfoModel *)model;

@end

@interface HR_BLELinkManager : NSObject<CBPeripheralDelegate>

- (instancetype)initWithPrepheral:(CBPeripheral *)peripheral;

@property (weak, nonatomic) id<BlueToothLinkDelegate>delegate;

/**
 接收指令
 
 @param CommandType CommandType
 */
- (void)analysisCommand:(CommandType)CommandType;

/** 定时器发送 获取设备状态 指令 */
@property (strong, nonatomic) NSTimer *timer;

/**
 开始计时器
 */
- (void)timerFire;

/**
 暂停计时器
 */
- (void)timerPause;

/**
 接收坡度信息
 
 @param gradient gradient description
 */
- (void)receiveGradient:(NSString *)gradient;

/**
 视频播放完成停止设备运行
 */
- (void)stopTheEquipmentRunning;

/**
 清空数据
 */
- (void)clear;

@end
